package com.fast.api.home.controller;

import com.fast.common.result.ApiResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.fast.common.controller.BaseApiController;
import com.fast.service.service.IUserDetailService;
import com.fast.api.home.param.UserDetailParam;
import com.fast.service.entity.UserDetail;

/**
 * 控制器
 * @author yueBanZi
 * @since 2021-12-03
 */
@RestController
@RequestMapping("/api/home/userDetail")
public class UserDetailController extends BaseApiController<IUserDetailService, UserDetail, UserDetailParam> {

    public UserDetailController(IUserDetailService userDetailService) {
        this.service = userDetailService;
    }

    @Override
    @PostMapping
    public ApiResult add(@Validated @RequestBody UserDetailParam param) {
        return super.add(param);
    }

    @Override
    @DeleteMapping("/{id}")
    public ApiResult delete(@PathVariable Long id) {
        return super.delete(id);
    }

    @Override
    @PutMapping("/{id}")
    public ApiResult edit(@PathVariable Long id, @Validated @RequestBody UserDetailParam param) {
        return super.edit(id, param);
    }

    @Override
    @GetMapping
    public ApiResult all(UserDetailParam param) {
         return super.all(param);
    }

    @Override
    @GetMapping("/{id}")
    public ApiResult detail(@PathVariable Long id) {
        return super.detail(id);
    }

}

